

public class 递归方法 {
    public static void main(String[] args) {
        System.out.println(getNumber(100));
    }

    public static int getNumber(int n){
        if (n == 1) {
            return n;
        }else {
            return n+getNumber(n-1);
        }
    }
}
